All Questions
76 questions
6votes
7answers
1kviews
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method. It works, but it's really ugly ...
4votes
1answer
947views
Writing a Java program that outputs a calorie/macronutrient plan for getting in shape over a certain amount of weeks
I am new to programming and was working on a project that calculates an entire "diet plan" as well as a projected weight goal for each week. There are three objects that all have methods ...
3votes
2answers
1kviews
How do I increase the speed of this loop or pixel color finding process?
I've been working on a program that should find the color red on the screen and then send out an alert. The issue is that the red color moves around a lot and the color finder moves too slow on the ...
1vote
2answers
155views
Improving Project Euler code problem #10
So, I just finished Problem 10 on Project Euler, but it took about 3 to 4 minutes for my output to come out, due to bad coding, I guess, any suggestions on how could I optimize my code? Question The ...
1vote
1answer
76views
StringModifier - Reverses a string and returns information about it
I have been coding in Java for about a month now and I'm seeking advice for my program on things I can improve. This project was mainly made for me to incorporate all the new things I learned and ...
4votes
4answers
1kviews
HackerRank Sales by Match
This is my first post. I'm switching from Python to Java and I've been practicing on HackerRank for some time. Today I solved this problem in which you have to ...
3votes
1answer
85views
Interactive logistic map
The purpose of this project is to generate an interactive logistic map. The user can click on the produced picture to magnify the picture at that point. Here is the logistic map equation: Here is my ...
3votes
2answers
183views
Interactive Mandelbrot set pictures
The purpose of this project is to generate an interactive Mandelbrot set. The user can specify the degree of magnification from the command-line and click on the produced picture to magnify the ...
9votes
4answers
2kviews
Simulating Brownian motion for N particles
The following is the web exercise 3.2.27. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a data type that represents a particle undergoing a Brownian ...
4votes
2answers
102views
Data-type implementation for vectors and drawing a vector field as a test client
The following is the web exercise 3.2.12. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a program that draws a vector field. A vector field associates a ...
3votes
1answer
81views
Data-type implementation for multiple dynamic histograms
This is almost exercise 3.2.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne (since I am self-studying, I changed it a little bit): Develop a version of ...
11votes
1answer
362views
Generating colorful Mandelbrot and Mandelbar set wallpapers
The following is the program 3.2.6. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: ...
5votes
1answer
261views
Drawing a Thue-Morse pattern recursively
This is web exercise 3.1.63. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a program that reads in a command line input N and plots the N-by-N Thue-...
3votes
1answer
280views
LeetCode 146: LRU Cache III
I'm posting my Java code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you! Problem Design and implement a data structure for Least Recently Used (LRU) cache....
2votes
0answers
810views
LeetCode 218: The Skyline Problem II
Here I'm posting my Java code for the skyline problem. If you have time and would like to review, please do so, I'd appreciate that. Problem A city's skyline is the outer contour of the silhouette ...